package net.csdn.business.common.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum OrgRelationTypeEnum {

    /**
     * 组织关联关系枚举
     */
    UP(1, "上级"),
    DOWN(2, "下级"),
    ;
    final Integer code;
    final String desc;

    public static OrgRelationTypeEnum ofCode(Integer code) {
        for (OrgRelationTypeEnum type : OrgRelationTypeEnum.values()) {
            if (type.code.equals(code)) {
                return type;
            }
        }
        throw new IllegalArgumentException("RelationType param error");
    }
}
